package com.woniuxy.driverschool.service.impl;/* *
@author author
@create 2021-09-29 20:09
*/

import com.woniuxy.driverschool.entity.User;
import com.woniuxy.driverschool.mapper.UserMapper;
import com.woniuxy.driverschool.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public void addUser(User user) {
        userMapper.insertUser(user);

    }

    @Override
    public void modifyUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public List<User> getUser(User user) {
        return userMapper.selectUsers(user);
    }

    @Override
    public User getUserById(int userId) {
        return null;
    }

    @Override
    public User getUserByUserName(String userName) {
        return userMapper.selectUserByUserName(userName);
    }

    @Override
    public void removeUserById(int userId) {
        userMapper.deleteUser(userId);
    }
}
